import myRequest from '@/service'

// 获取
export function getPageListData(pageName: string, queryInfo: any) {
  return myRequest.get({
    url: `/${pageName}`,
    params: queryInfo
  })
}

// 新增
export function addPage(pageName: string, addInfo: any) {
  return myRequest.post({
    url: `/${pageName}`,
    data: addInfo
  })
}

// 编辑
export function editPage(pageName: string, id: number, editInfo: any) {
  return myRequest.put({
    url: `/${pageName}/${id}`,
    data: editInfo
  })
}

// 删除
export function deletePageById(pageName: string, id: number) {
  return myRequest.delete({
    url: `/${pageName}/${id}`
  })
}

// 状态
export function editStatus(pageName: string, id: number) {
  return myRequest.patch({
    url: `/${pageName}/${id}`
  })
}
